<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Site extends Controller_Template {
	
	public $template = 'templates/site';
	
	public $styles = array();
	public $scripts = array();
	
	public function before(){
		parent::before();
		
		if(isset($_GET['store'])){
			$this->request->redirect(URL::site('store/index?store=' . $_GET['store']));	
		}
		
		$app_config = Kohana::config('app.default');
		
		$this->template->title = $app_config['title'];
		$this->template->meta_keywords = $app_config['meta_keywords'];
		$this->template->meta_description = $app_config['meta_description'];
		$this->template->meta_copyright = $app_config['meta_copyright'];
		
		$this->template->header = '';
		$this->template->content = '';
		$this->template->footer = '';
		
	}
	
	public function after(){
		$app_config = Kohana::config('app.default');
		$this->template->styles = array_merge( $this->styles, $app_config['styles']);
		$this->template->scripts = array_merge( $this->scripts, $app_config['scripts']);
		
		parent::after();
	}
	
	public function action_index(){
		$this->template->content = 'Bienvenido a PHProducts!';
	}
	
	public function action_createStore(){
		
	}
}


	